home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr49 / 112_01.zip / ANYDISK.OUT < prev    next >
Text File  |  1993-06-19  |  8KB  |  264 lines

  1.  
  2.  
  3. ANYDISK                                        July 27, 1982
  4.  
  5.  
  6.  
  7. The___ authors_______ 
  8.  
  9.    The original  version  of  this  program  was  written by
  10. Richard Damon. Robert Ward rewrote the  program  and  called
  11. it  DDNDISK.  Edward  K.  Ream  further  modified DDNDISK to
  12. produce ANYDISK. Please send all reports of bugs to: 
  13.  
  14.         Edward K. Ream 
  15.         1850 Summit Ave.  
  16.         Madison, WI 53705 
  17.         (608) 231 - 2952 
  18.  
  19.  
  20. The___ commands________ 
  21.  
  22.    This program allows the operator to examine and modify  a
  23. CP/M disk.  The commands available are: 
  24.  
  25. Bn  Set  current  track  and  sector to point at block n and
  26.     enter block mode.  
  27. Cn  Fill buffer with SIGNED value n.  
  28. Dn  Set current disk number to  n  (0--#  of  drives-1)  and
  29.     print disk information.  
  30. Ea n n ... n    Edit buffer starting from location a. 
  31. Fn  Fill buffer with UNSIGNED value n.  
  32. H   Print help message.  
  33. I   Convert  block  to  track  and  sector  and enter sector
  34.     mode.  
  35. M   Print the directory and the disk allocation map.  
  36. N   Go to next block or track/sector.  
  37. P   Print contents of buffer. 
  38. R   Read sector or block into buffer (depending on mode).  
  39. Sn  Set current sector to n (0--# of  sectors  per  track-1)
  40.     and enter sector mode.  
  41. Tn  Set  current  track  to  n  (0--# of tracks  per disk-1)
  42.     and enter sector mode.  
  43. W   Write sector or block from buffer (depending on mode).  
  44. X   Exit program.  
  45.  
  46. Notes: 
  47. 1. Multiple commands may be specified on a line  except  for
  48.    the  X  command  which  must  be  the only command on the
  49.    line.  
  50. 2. Commands may be in upper or lower case letters.  
  51. 3. Spaces are ignored except in the  E  command  where  they
  52.    are used as separaters for the numbers.  
  53.  
  54. Typical commands: 
  55.  
  56. d0t0s1rp        read in the track 0 sector 1 of 
  57.                 disk 0 (drive A) and print it.  
  58.  
  59. e1A 4F          set buffer location 1A to 4F and 
  60.                 set buffer location 1B to 20.  
  61.  
  62.  
  63.  
  64.                             -1-
  65.  
  66.  
  67.  
  68.  
  69. ANYDISK                                        July 27, 1982
  70.  
  71.  
  72. e0a  00w        Set  buffer  location  0a  to  0 and write
  73.                 buffer.  Note no space after last data byte.
  74.  
  75. b0rp            print the entire first block.  
  76.  
  77. b0irp           print the first sector of the first block.  
  78.  
  79.  
  80. The___ disk____ allocation__________ map___ 
  81.  
  82.    The M command  prints  the  directory  in  two  sections.
  83. Section  1  is  a  listing  of  each  directory  entry.  For
  84. instance, entry 15 in the directory would be listed as: 
  85.  
  86.         15 = DDNDISK C:0 
  87.  
  88. The equal sign means the entry is valid.  A star  (*)  would
  89. be  printed  instead  of  the  equal  sign if the entry were
  90. deleted.  The number  following  the  colon  is  the  extent
  91. number.  
  92.  
  93.    The second  section  is  a disk allocation map.  There is
  94. one entry in this map for every block on the disk.   If  the
  95. block  is  not  allocated  to any file, the characters "..."
  96. appear. Otherwise, a number appears.  This number refers  to
  97. the  number  of  the  directory  entry  which  allocated the
  98. block.  Refer back to section 1 to see which file  allocated
  99. the block.  
  100.  
  101.  
  102. The___ structure_________ of__ a_ CP__/M_ 2_.x_ disk____ 
  103.  
  104.    Here is  a brief description of the CP/M 2.x disk format.
  105. Several tracks are typically reserved for the bootstrap  and
  106. a  copy  of  CCP and BDOS.  The number of reserved tracks is
  107. determined by BIOS for each type of disk.   This  number  is
  108. called  the  track  offset; it is printed by the 'D' command
  109. when a disk is selected.  
  110.  
  111.    Most commands deal with the track  offset  automatically.
  112. The  only  exception is the 'T' command.  When using the 'T'
  113. command, you must add the offset yourself.   Thus,  you  can
  114. access ANY track with the 'T' command.  
  115.  
  116.    Tracks following  the  reserved  tracks  store  data.  To
  117. speed  up  disk  access,  CP/M  does  not  store   data   in
  118. consecutive  sectors.   The  sector translate table converts
  119. from logically consecutive sectors to the order  that  those
  120. sectors  are  actually  stored  on the disk.  (This table is
  121. used only on CP/M 2.x versions.) 
  122.  
  123.    All commands deal with LOGICAL sector numbers.   This  is
  124. what  you almost always want.  Whenever a sector is printed,
  125. both the logical and  physical  sector  numbers  are  shown.
  126. Thus, if you can find any physical sector if you must.  
  127.  
  128.  
  129.                             -2-
  130.  
  131.  
  132.  
  133.  
  134. ANYDISK                                        July 27, 1982
  135.  
  136.  
  137.  
  138.    A block  is  the  smallest  unit  of  a disk which can be
  139. allocated to a file.  The size of a block is a  multiple  of
  140. 128  bytes.   The  block size is determined by BIOS for each
  141. type of  disk.   The  block  size  is  printed  by  the  'D'
  142. command.  
  143.  
  144.    Several blocks  are reserved at the beginning of the disk
  145. for the directory.  Again, the number of reserved blocks  is
  146. determined  by  BIOS  for each type of disk.  This number is
  147. also printed by the 'D' command.  
  148.  
  149.    The format  of  each  entry  of  the  directory   is   as
  150. follows.  Each entry describes one extent of a file.  
  151.  
  152. byte   0    : file code : 0 if file exists, 0xe5 if deleted
  153. bytes  1- 8 : file name : file name (ascii)
  154. bytes  9-11 : file type : file type (ascii)
  155. byte   12   : file ext  : extent number (binary)
  156. bytes  13,14: unused
  157. bytes  15   : rec count : count of number of sectors in extent
  158. bytes  16-31: map       : list of blocks used by this extent
  159.  
  160.    Please note  that  byte 15 is NOT a reliable guide to the
  161. number of blocks allocated to a file.  The way  to  tell  is
  162. simply  to  count  the  blocks in the map.  Block 0 is never
  163. allocated to any file and it signals the  end  of  the  map.
  164. Remember  that  block  numbers  take  either  1  or  2 bytes
  165. depending on whether there  are  less  than  256  blocks  or
  166. not.  
  167.  
  168.  
  169. Differences___________ between_______ DDNDISK_______ and___ ANYDISK_______ 
  170.  
  171. o  ANYDISK  uses  the  CP/M  2.x BIOS select disk routine to
  172.    get the characteristics of the disk  dynamically.   Thus,
  173.    different  kinds_____ of disks may be used without recompiling
  174.    the program.  
  175.    
  176. o  ANYDISK  will  work  even  with  hard   disks.    Several
  177.    arithmetic  statements  have been converted into loops in
  178.    order to avoid overflow problems.  This also  means  that
  179.    a  single  index variable can NOT be used.  Instead,  the
  180.    current block, track and sector  numbers  are  maintained
  181.    separately.  
  182.    
  183. o  The  code  that computes the disk map now needs lots less
  184.    memory.  Only one disk block at  a  time  is  now  loaded
  185.    into memory.  
  186.    
  187. o  The  disk map now is more readable.  The format is useful
  188.    even for hard disks.  Directory entries which  have  0xe5
  189.    for a file name are completely ignored.  
  190.    
  191.  
  192.  
  193.  
  194.  
  195.                             -3-
  196.  
  197.  
  198.  
  199.  
  200. ANYDISK                                        July 27, 1982
  201.  
  202.  
  203. o  The   'D'   command   now   prints   a   summary  of  the
  204.    characteristics of the selected disk.  
  205.    
  206. o  The 'H' command is new.  It prints a help message.  
  207.    
  208. o  The 'I' command is now useful for  printing  parts  of  a
  209.    block.   For  example,  to  print just the 5'th record of
  210.    block 20 use: 
  211.    
  212.            b20i nnnn rp 
  213.    
  214. o  The 'W' command now tells BIOS that  all  writes  are  to
  215.    the  directory.   This  forces  BIOS  to  do the write at
  216.    once.  
  217.    
  218. o  You get a more informative prompt if  you  type  a  value
  219.    which is out of range.  
  220.    
  221. o  The  ptmap  routine  contains  two  constants,  M1COL and
  222.    M2COL which control how many entries will be put on  each
  223.    line  for  the  directory  list  and  the disk allocation
  224.    map.  I use fairly small values because  my  screen  only
  225.    has 64 columns.  Choose the constants you like best. 
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.                             -4-
  262.  
  263.  
  264. ts you like